const baseConfig = require("./webpack.base")
const devConfig = require('./webpack.config.dev')
const prodConfig = require('./webpack.config.prod')

module.exports = (env) => {


  if (env && env.prod) {

    const plugins = [
      ...baseConfig.plugins,
      ...prodConfig.plugins,
    ]
    return {
      ...baseConfig,
      ...prodConfig,
      plugins
    }
  } else {
    console.log("devConfig-->", devConfig)
    const plugins = [
      ...baseConfig.plugins,
    ]

    if (devConfig.plugins) {

      plugins.push(...devConfig.plugins)
    }

    return {
      ...baseConfig,
      ...devConfig,
      plugins
    }
  }




}